onCaptureSharedElementSnapshot

open fun onCaptureSharedElementSnapshot(sharedElement: View, viewToGlobalMatrix: Matrix, screenBounds: RectF): Parcelable(source)

Creates a snapshot of a shared element to be used by the remote Activity and reconstituted with onCreateSnapshotView. A null return value will mean that the remote Activity will have a null snapshot View in onSharedElementStart and onSharedElementEnd.

This is not called for Fragment Transitions.

Return

A snapshot to send to the remote Activity to be reconstituted with onCreateSnapshotView and passed into onSharedElementStart and onSharedElementEnd.

Parameters

sharedElement

The shared element View to create a snapshot for.

viewToGlobalMatrix

A matrix containing a transform from the view to the screen coordinates.

screenBounds

The bounds of shared element in screen coordinate space. This is the bounds of the view with the viewToGlobalMatrix applied.